-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate asset FT extensions with the DEX. #1029
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1029 +/- ##
==========================================
+ Coverage 52.48% 60.47% +7.98%
==========================================
Files 141 159 +18
Lines 16262 18542 +2280
==========================================
+ Hits 8535 11213 +2678
+ Misses 6615 6231 -384
+ Partials 1112 1098 -14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 16 files at r1, 4 of 6 files at r2, all commit messages.
Reviewable status: 5 of 16 files reviewed, 3 unresolved discussions (waiting on @dzmitryhil, @masihyeganeh, and @ysv)
a discussion (no related file):
you should run cargo fmt
in the root of the project. some of the style changes that you editor has applied are not default rust style.
x/asset/ft/keeper/test-contracts/asset-extension/src/contract.rs
line 282 at r2 (raw file):
let bank_balance = query_bank_balance(deps, account, &token.denom)?; let whitelisted_balance = query_whitelisted_balance(deps, account, &token.denom)?;
we should account for expected to receieve when calculating whitelisting, to showcase how full integration looks likes.
x/asset/ft/keeper/keeper_dex.go
line 105 at r2 (raw file):
expectedToSpend, expectedToReceive sdk.Coin, ) error { if err := k.dexCheckExpectedToSpend(ctx, order, expectedToSpend, expectedToReceive); err != nil {
I might be a little confused, but I am not seeing where the whitelisting limits are enforced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 5 of 16 files reviewed, 3 unresolved discussions (waiting on @masihyeganeh, @miladz68, and @ysv)
a discussion (no related file):
Previously, miladz68 (milad) wrote…
you should run
cargo fmt
in the root of the project. some of the style changes that you editor has applied are not default rust style.
Done.
x/asset/ft/keeper/keeper_dex.go
line 105 at r2 (raw file):
Previously, miladz68 (milad) wrote…
I might be a little confused, but I am not seeing where the whitelisting limits are enforced.
In dexCheckExpectedToReceive
x/asset/ft/keeper/test-contracts/asset-extension/src/contract.rs
line 282 at r2 (raw file):
Previously, miladz68 (milad) wrote…
we should account for expected to receieve when calculating whitelisting, to showcase how full integration looks likes.
You can query it with the asset FT, Balance
query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 8 of 16 files at r1, 6 of 6 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @dzmitryhil, @miladz68, and @ysv)
x/asset/ft/keeper/keeper_dex_test.go
line 1067 at r3 (raw file):
testApp.MintAndSendCoin(t, ctx, acc, sdk.NewCoins(coinWithoutExtension)) // the extension controls all features, bot to locked, amount
typo?
x/asset/ft/keeper/keeper_dex_test.go
line 1119 at r3 (raw file):
) coinWithExtensionProhibitedToReceive := sdk.NewCoin(extensionDenom, sdkmath.NewInt(104))
Please define these magic numbers as a constant just like integration-tests/modules/assetft_extension_test.go
x/asset/ft/keeper/keeper_dex.go
line 407 at r3 (raw file):
} if spendDef.IsFeatureEnabled(types.Feature_extension) {
Should we just check if extension is enabled? I believe it's better to change such conditions to check if they implemented that entry point (extension_place_order
in this case). I'm not sure if we can check for that or not, but I believe it's the better implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 7 of 16 files at r1, 2 of 6 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @dzmitryhil and @ysv)
x/asset/ft/keeper/keeper_dex.go
line 105 at r2 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
In
dexCheckExpectedToReceive
I am not sure about whitelisting edge cases. let's discuss in a call.
x/asset/ft/keeper/test-contracts/asset-extension/src/contract.rs
line 282 at r2 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
You can query it with the asset FT,
Balance
query.
I mean that we should do this in our integration tests as a showcase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @dzmitryhil and @ysv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @masihyeganeh, @miladz68, and @ysv)
x/asset/ft/keeper/keeper_dex.go
line 105 at r2 (raw file):
Previously, miladz68 (milad) wrote…
I am not sure about whitelisting edge cases. let's discuss in a call.
OK
x/asset/ft/keeper/keeper_dex.go
line 407 at r3 (raw file):
Previously, masihyeganeh (Masih Yeganeh) wrote…
Should we just check if extension is enabled? I believe it's better to change such conditions to check if they implemented that entry point (
extension_place_order
in this case). I'm not sure if we can check for that or not, but I believe it's the better implementation
They must be implemented if they want the FT with an extension to work with the DEX. That was the requirement we agreed on.
x/asset/ft/keeper/keeper_dex_test.go
line 1067 at r3 (raw file):
Previously, masihyeganeh (Masih Yeganeh) wrote…
typo?
Done
x/asset/ft/keeper/keeper_dex_test.go
line 1119 at r3 (raw file):
Previously, masihyeganeh (Masih Yeganeh) wrote…
Please define these magic numbers as a constant just like
integration-tests/modules/assetft_extension_test.go
Agree, updated.
x/asset/ft/keeper/test-contracts/asset-extension/src/contract.rs
line 282 at r2 (raw file):
Previously, miladz68 (milad) wrote…
I mean that we should do this in our integration tests as a showcase.
I don't think that this contract is a good example of how to use whitelisting.
…dzmitryhil/dex-extentions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r5, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @miladz68 and @ysv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @miladz68 and @ysv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r4, 4 of 4 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ysv)
# Conflicts: # x/asset/ft/keeper/keeper.go # x/asset/ft/keeper/keeper_dex.go # x/dex/keeper/keeper_matching_fuzz_test.go # x/wbank/keeper/keeper.go # x/wbank/types/expected_keepers.go
c7119b7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 9 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ysv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 9 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ysv)
Description
Integrate asset FT extensions with the DEX.
Reviewers checklist:
Authors checklist
This change is